//
//  TabBarViewController.m
//  Xiangmu
//
//  Created by 이경인 on 2017/10/11.
//  Copyright © 2017年 LIJINGREN. All rights reserved.
//

#import "TabBarViewController.h"
#import "ShouyeViewController.h"
#import "PeixunViewController.h"
#import "ShaituViewController.h"
#import "JulebuViewController.h"

@interface TabBarViewController ()

@end

@implementation TabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    //执行加载方法
    [self genshitu];
    
}

- (void)genshitu {
    
//    UITabBarController *tb=[[UITabBarController alloc]init];
//    ShouyeViewController *shouye=[[ShouyeViewController alloc]init];
//    UINavigationController *shouyeNC = [[UINavigationController alloc] initWithRootViewController:shouye];
//    shouye.view.backgroundColor=[UIColor whiteColor];
//    shouye.tabBarItem.title=@"1111";
//    shouye.tabBarItem.image=[UIImage imageNamed:@"shouye1.jpg"];
//    shouye.tabBarItem.selectedImage = [UIImage imageNamed:@"shouye2.jpg"];
//    shouye.tabBarItem.badgeValue=@"123";
//
//    PeixunViewController *peixun=[[PeixunViewController alloc]init];
//    UINavigationController *peixunNC = [[UINavigationController alloc] initWithRootViewController:peixun];
//    peixun.view.backgroundColor=[UIColor whiteColor];
//    peixun.tabBarItem.title=@"1111";
//    peixun.tabBarItem.image=[UIImage imageNamed:@"peixun1.jpg"];
//    peixun.tabBarItem.selectedImage = [UIImage imageNamed:@"peixun2.jpg"];
//    peixun.tabBarItem.badgeValue=@"123";
//
//    ShaituViewController *shaitu=[[ShaituViewController alloc]init];
//    UINavigationController *shaituNC = [[UINavigationController alloc] initWithRootViewController:shaitu];
//    shaitu.view.backgroundColor=[UIColor whiteColor];
//    shaitu.tabBarItem.title=@"1111";
//    shaitu.tabBarItem.image=[UIImage imageNamed:@"shaitu1.jpg"];
//    shaitu.tabBarItem.selectedImage = [UIImage imageNamed:@"shaitu2.jpg"];
//    shaitu.tabBarItem.badgeValue=@"123";
//
//    JulebuViewController *julebu=[[JulebuViewController alloc]init];
//    UINavigationController *julebuNC = [[UINavigationController alloc] initWithRootViewController:julebu];
//    julebu.view.backgroundColor=[UIColor whiteColor];
//    julebu.tabBarItem.title=@"1111";
//    julebu.tabBarItem.image=[UIImage imageNamed:@"julebu1.jpg"];
//    julebu.tabBarItem.selectedImage = [UIImage imageNamed:@"julebu2.jpg"];
//    julebu.tabBarItem.badgeValue=@"123";
//
//    tb.viewControllers=@[shouye,peixun,shaitu,julebu];
//    NSArray *genshituArray = @[shouyeNC,peixunNC,shaituNC,julebuNC];
//        [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
//        [self setViewControllers:genshituArray animated:YES];
//
    ShouyeViewController *shouyeVC = [[ShouyeViewController alloc] init];
    UINavigationController *shouyeNC = [[UINavigationController alloc] initWithRootViewController:shouyeVC];
    shouyeVC.tabBarItem.image = [UIImage imageNamed:@"shouye1"];
    shouyeVC.tabBarItem.selectedImage =[UIImage imageNamed:@"shouye2"];
    shouyeVC.title = @"首页";

    PeixunViewController *peixunVC = [[PeixunViewController alloc] init];
    UINavigationController *peixunNC = [[UINavigationController alloc] initWithRootViewController:peixunVC];
    peixunVC.tabBarItem.image = [UIImage imageNamed:@"peixun1"];
    peixunVC.tabBarItem.selectedImage =[UIImage imageNamed:@"peixun2"];
    peixunVC.title = @"培训";

    ShaituViewController *shaituVC = [[ShaituViewController alloc] init];
    UINavigationController *shaituNC = [[UINavigationController alloc] initWithRootViewController:shaituVC];
    shaituVC.tabBarItem.image = [UIImage imageNamed:@"shaitu1"];
    shaituVC.tabBarItem.selectedImage =[UIImage imageNamed:@"shaitu2"];
    shaituVC.title = @"晒图";

    JulebuViewController *julebuVC = [[JulebuViewController alloc] init];
    UINavigationController *julebuNC = [[UINavigationController alloc] initWithRootViewController:julebuVC];
    julebuVC.tabBarItem.image = [UIImage imageNamed:@"julebu1"];
    julebuVC.tabBarItem.selectedImage =[UIImage imageNamed:@"julebu2"];
    julebuVC.title = @"俱乐部";

    NSArray *genshituArray = @[shouyeNC,peixunNC,shaituNC,julebuNC];
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
    [self setViewControllers:genshituArray animated:YES];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
